package cn.com.ccxe.web.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;

import com.ccxe.manage.service.CurrUserInfo;

public class TypeActionForm extends ActionForm {

	private int 			id;
	private int 			isStart;
	private String 			type;
	private String 			method;
	private CurrUserInfo 	userInfo;

	public TypeActionForm(HttpServletRequest request) {
		super(request);
	}

	@Override
	protected void reset() {
		String str_id = getParemetes("id");
		if (isEmpty(str_id)) {
			this.id = Integer.parseInt(str_id);
		}
		String str_isStart = getParemetes("isStart");
		if(isEmpty(str_isStart)) {
			this.isStart = Integer.parseInt(str_isStart);
		}
		this.type = getParemetes("type");
		this.method = getParemetes("method");
		this.userInfo = (CurrUserInfo) getAttribute("currUser");
	}
	
	private boolean isEmpty(String str) {
		return !StringUtils.isEmpty(str);
	}

	public void clearMethod(){
		this.method="";
	}

	public int getId() {
		return id;
	}
	public int getIsStart() {
		return isStart;
	}

	public String getType() {
		return type;
	}

	public String getMethod() {
		return method;
	}

	public CurrUserInfo getUserInfo() {
		return userInfo;
	}
}